﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="adm_surveyoption.aspx.cs" Inherits="adm_surveyoption" Title="Untitled Page" %>
<%@ Register src="UserControls/AdminMenuLeft.ascx" tagname="AdminMenuLeft" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <script language="javascript" type="text/javascript">
        function checkvalidate(obj)
        {
            if( document.getElementById(obj).innerText!="")
            {
                alert('aaaaaaaaaaaaaaaaa');
            }
        }
    </script>
	<div class="adm-wrap">
		<h3>Response Option</h3>
		<div class="country max" style="border:0px">
			<p class="hi"><asp:Label ID="lblGretting" Text="Hi admin Khuong luu" runat="server"></asp:Label></p>
			<p class="hi"><asp:Label ID="lblAlert" runat="server" style="border:solid 1px Gray;padding:3px" Text="aaaaaaaaa" Visible="false"></asp:Label></p>
            <p>Question:<br /><br /><asp:Label ID="lblQuestion" runat="server"></asp:Label></p>
			<p>&nbsp;</p>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="clstitle">Response Option</td>
                    <td>
                    	<asp:TextBox CssClass="ps_message" id="txtbodyVN" runat="server" Width="500px" Height="150px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="txtbodyVN" ErrorMessage="Enter Response Option"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <asp:Button CssClass="submitbutton" ID="btnCommit" runat="server" 
                            Text="Add New Response Option" Width="170px" onclick="btnCommit_Click" /> 
                        <asp:Button CssClass="submitbutton" ID="btnUpdate" runat="server" 
                            Text="Update Response Option" Width="150px" onclick="btnUpdate_Click" 
                            Visible="False"/> 
                    </td>
                </tr>
            </table>
            <hr />
		    <div class="sort">
			    <ul>
			    <li class='<%= GetActiveClassAll()%>'><a href='<%= _CreateLinkforAll() %>'>All</a></li>
			    <asp:Repeater ID="rptAlphabetSearch" runat="server">
			        <ItemTemplate>
			            <li class='<%# GetActiveClass(Eval("Name").ToString())%>'><a href='adm_surveyoption.aspx?ckid=<%# ckid %>&fn=<%# Eval("Name") %>&qid=<%# Request.Params["qid"]%>'><%# Eval("Name") %></a></li>
			        </ItemTemplate>
			    </asp:Repeater>
			    </ul>
			</div>
		    
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr class="first">
                    <td width="50%">Response</td>
                    <td width="11%">Count</td>
					<td width="11%">Percent</td>
                    <td width="28%">Action</td>    
                </tr>
                <asp:Repeater ID="rptSurvey" runat="server">
                    <ItemTemplate>
                        <tr class="second">
                            <td><%# Eval("RespOption")%></td>
                            <td><%# Eval("RespCount")%></td>
                            <td><%# Calculatepercent(int.Parse(Eval("RespCount").ToString())) %></td>
                            <td><%# CreateEditDeleteCommentLink(int.Parse(Eval("ID").ToString()),int.Parse(Eval("QID").ToString()))%></td>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class="second_se">
                            <td><%# Eval("RespOption")%></td>
                            <td><%# Eval("RespCount")%></td>
                            <td><%# Calculatepercent(int.Parse(Eval("RespCount").ToString())) %></td>
                            <td><%# CreateEditDeleteCommentLink(int.Parse(Eval("ID").ToString()),int.Parse(Eval("QID").ToString()))%></td>
                        </tr>
                    </AlternatingItemTemplate>
                </asp:Repeater>
                <tr>
                    <td>Total:<%= totalRes%></td>
                    <td></td>
                </tr>
            </table>
		</div>
	</div>
	<div class="clear"></div>
  <!--//Content-->
</asp:Content>

